package br.com.devteam.sgap.service;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import br.com.devteam.sgap.repository.BasicDAO;
import br.com.devteam.sgap.repository.DAOException;

public interface IServiceBasic {
	
	public <T> void setEntity(T bean);
	
	public <T> T findById(Class<T> entityClass, Serializable id);

	public <T> List<T> findByNamedQuery(String s);
	
	public <T> List<T> findByNamedQuery(String namedQuery,
			Map<String, Object> namedParams);
	
	public <T> void delete(T bean);
	
	public <T> void update(T bean);
	
	public <T> T saveFlushAndClear(T bean);
	
	public <T> T save(T bean);
	
	public <T> List<T> findByQuery(String hql, Map<String, Object> namedParams,
			int maxResults) throws DAOException;
	
	public <T> List<T> findByQuery(String hql, Map<String, Object> namedParams);
	
	public <T> List<T> findByNamedQuery(String namedQuery, int maxResults);
	
	public <T> List<T> findByNamedQuery(String namedQuery,
			Map<String, Object> namedParams, int maxResults);
	
	public BasicDAO getDao();
}
